package day09;

public class ThreadSetDaemon {

	public static void main(String[] args) {
		
		Thread rose = new Thread() {
			public void run() {
				for (int i = 0; i < 5; i++) {
					try {
						Thread.sleep(1000);
					} catch (InterruptedException e) {
					}
					System.out.println("rose:let me go!");
				}
				System.out.println("rose:tiao l ,扑通扑通！");
			}
		};
		

		Thread jack = new Thread() {
			public void run() {
				while (true) {
					try {
						Thread.sleep(1000);
					} catch (InterruptedException e) {
					}
					System.out.println("jack:you jump,i jump!");
				}
			}
		};
		
		
		Thread jhone=new Thread(){
			
			public void run(){
				while(true){
					try {
						Thread.sleep(1000);
					} catch (InterruptedException e) {
					}
				System.out.println("jhone: Rose! Dot not jump!");
				
				}
			}
			
		};
		
		
		rose.start();
		
//后台线程要单独设定，并在start前调用	
		jack.setDaemon(true);
		jack.start();
		
		jhone.setDaemon(true);
		jhone.start();
		
		
	}

}
